package com.example._07servlet;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;


public class Response2 extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        resp.setContentType("text/html; charset=UTF-8");
        resp.getWriter().write("<!DOCTYPE html>\n" +
                "<html lang=\"en\">\n" +
                "<head>\n" +
                "    <meta charset=\"UTF-8\">\n" +
                "    <title>Title</title>\n" +
                "</head>\n" +
                "<body>\n" +
                "<form action=\"http://localhost:8080/07_servlet/requestApi2\" method=\"get\">\n" +
                "    姓名：<input type=\"text\" name=\"username\"><br>\n" +
                "    密码：<input type=\"password\" name=\"password\"><br>\n" +
                "    <input type=\"checkbox\" name=\"temp\" value=\"java\">java<br>\n" +
                "    <input type=\"checkbox\" name=\"temp\" value=\"c++\">c++<br>\n" +
                "    <input type=\"checkbox\" name=\"temp\" value=\"python\">python<br>\n" +
                "<input type=\"submit\">\n" +
                "</form>\n" +
                "</body>\n" +
                "</html>");
    }
}
